package org.flashbrighton.as3bots.collision
{
	import flash.display.Sprite;
	import org.flashbrighton.as3bots.events.BotEvent;
	import org.flashbrighton.as3bots.geom.Metrics;

	public class Collidable extends Sprite
	{

		private  var mMetrics:Metrics;
		
		/**
		 * Constructor.
		 */
		public function Collidable(m:Metrics)
		{
			mMetrics = m;
			applyRotation();
			applyPos(0);

		}
		

		public function get metrics():Metrics
		{
			
			return mMetrics;
			
		}
		

		// applies the position stored in the metrics to the x and y values of the Collidable.
		public function applyPos(t:Number = 1):void
		{
			
			mMetrics.applyVector(t);
			x = mMetrics.circle.x;
			y = mMetrics.circle.y;
			
		}
		
		// applies the rotation stored in the metrics to the rotation of the Collidable.
		public function applyRotation():void
		{
			rotation = mMetrics.circle.rotation;
			
		} 
		
		public function notify(event:BotEvent):void
		{
			
		}
		
	}
}